
// copy selection text to the LivCos clipboard
(function(){
	var a=window,d=document,e=encodeURIComponent,
	s=e((d.selection)?d.selection.createRange().text:getSelection()),
	w=a.open('http://localhost:8080/livcos/cb.job?u='+e(d.location)+'&t='+e(d.title)+'&s='+s,
			'cb','width=420,height=230,dialog=1,alwaysRaised=1,centerscreen');
	a.setTimeout(function(){w.focus()},300);
})()

javascript:(function(){var a=window,d=document,e=encodeURIComponent,s=e((d.selection)?d.selection.createRange().text:getSelection()),w=a.open('http://localhost:8080/livcos/cb.job?u='+e(d.location)+'&t='+e(d.title)+'&s='+s,'cb','width=420,height=230,dialog=1,alwaysRaised=1,centerscreen');a.setTimeout(function(){w.focus()},300);})()

// scan for selected id attribute
(function(){
var n=getSelection().anchorNode;
while(n){
	if(n.id)break;
	n=n.parentNode;
}
alert(n.id);
})()

javascript:(function(){function i(){var n=getSelection().anchorNode;while(n){if(n.id)return n.id;n=n.parentNode;}}alert(i());})()

// all together
(function(){
var a=window,d=document,e=encodeURIComponent,s=getSelection(),n=s.anchorNode;
while(n){
	if(n.id)break;
	n=n.parentNode;
}
var w=a.open('http://localhost:8080/livcos/cb.job?u='+e(d.location)+((n)?'&i='+n.id:'')+'&t='+e(d.title)+'&s='+e(s),
		'cb','width=420,height=230,dialog=1,alwaysRaised=1,centerscreen');
a.setTimeout(function(){w.focus()},300);
})()

javascript:(function(){var a=window,d=document,e=encodeURIComponent,s=getSelection(),n=s.anchorNode;while(n){if(n.id)break;n=n.parentNode;}var w=a.open('http://localhost:8080/livcos/cb.job?u='+e(d.location)+((n)?'&i='+n.id:'')+'&t='+e(d.title)+'&s='+e(s),'cb','width=420,height=230,dialog=1,alwaysRaised=1,centerscreen');a.setTimeout(function(){w.focus()},300);})()

